<?php


namespace app\admin\model;


use think\Model;

class AdminAccessLog extends Model
{

    protected $pk = 'id';


    public function getList($where, $listRows=10,$params=[]){

        return $this->where($where)->order('id desc')->paginate($listRows,false,['query'=>$params]);
    }


    public function getOne($id){

        return $this->where($this->pk,'=',$id)->find();
    }

    // 写入操作日志
    public function writeLog($data){
        $data['create_time'] = time();
        return $this->insertGetId($data);
    }

}